﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ViewOrder.aspx.cs" Inherits="IMS_WEB.ViewOrder" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">


    .auto-style5 {
        width: 78px;
    }
        .auto-style7 {
            width: 154px;
        }
        .auto-style9 {
            width: 180px;
        }
        .auto-style10 {
            height: 17px;
        }
        .auto-style11 {
            height: 17px;
            width: 78px;
        }
        .style1
        {
            height: 17px;
            width: 78px;
        }
        .style2
        {
            height: 17px;
        }
        .style3
        {
            width: 249px;
        }
        .style4
        {
            width: 242px;
        }
        .style5
        {}
    </style>

     <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    
    <script type="text/javascript" src="scripts/jquery-1.9.1.js"></script>
    
     
     <script src="Scripts/jquery-ui.js"></script>
     <script src="Scripts/jquery.ui.datepicker-zh-CN.js"></script>
  <script>
      $(function () {
          $("#startDate").datepicker( { changeYear: true });
          //$("#startDate").datepicker("option", "changeYear", true);
          $("#endDate").datepicker( { changeYear: true });
      });
  </script>
  <script type="text/javascript" src="scripts/jquery-1.4.1.min.js"></script>
  <script type="text/javascript">
      var count = 1;
      function add() {
          var content = "<tr>";
          content += "<td class='auto-style5'>商品</td>";
          content += "<td> <input id='Text1' type='text' ";
          count += 1;
          content += "name='product_" + count + "'";
          content += " /> </td>";
          content += "</tr>";
          $("#productTable").append(content);
    }
  </script>
  

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <br />
    <table class="auto-style1">
        <tr>
            <td class="style4">选择厂商&nbsp;<ajaxToolkit:ToolkitScriptManager 
                    ID="ToolkitScriptManager1" runat="server">
                </ajaxToolkit:ToolkitScriptManager>
                <asp:TextBox ID="tbCompany" runat="server" ></asp:TextBox>
                <ajaxToolkit:AutoCompleteExtender ID="tbCompany_AutoCompleteExtender" 
                    runat="server" DelimiterCharacters="" Enabled="True" ServicePath="~/WebService.asmx"  ServiceMethod="GetCompanyList"
                    TargetControlID="tbCompany" MinimumPrefixLength="1">
                </ajaxToolkit:AutoCompleteExtender>
            </td>
            <td class="style3">&nbsp;开始日期&nbsp;&nbsp;
 
                <input type="text" id="startDate" name="startDate" value="<%=startDate %>" />
</td>
            <td>结束日期 <input type="text" id="endDate" name="endDate" value="<%=endDate %>" /></asp:TextBox>
&nbsp; </td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td class="style4">按状态查询 （未发货、发货等）<asp:DropDownList ID="orderStatusList" 
                    runat="server" CssClass="style5" Height="20px" Width="128px">
                </asp:DropDownList>
                </td>
            <td class="style3">&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
    </table>
&nbsp;<table class="auto-style1" id="productTable">
        <tr>
            <td class="style1">指定商品类型</td>
            <td class="style2"></td>
        </tr>
        
        <tr>
            <td class="auto-style5">
                <input id="addProductType" type="button" value="添加商品类型" onclick="add()"/></td>
            <td>
                &nbsp;&nbsp;</td>
        </tr>
        <tr>
            <td class="auto-style5">商品</td>
            <td>
                <input id="Text1" type="text" name="product_1" /></td>
        </tr>
    </table>
    <br />
    <table class="auto-style1">
        <tr>
            <td>
                <asp:Button ID="Button4" runat="server" style="width: 78px" Text="查询定单" 
                    onclick="Button4_Click" />
                <br />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
        <td>
            <asp:GridView ID="GridView1" runat="server" Width="925px" 
                AutoGenerateColumns="False"
                DataSourceID="EntityDataSource1" 
                onrowcancelingedit="GridView1_RowCancelingEdit" 
                onrowdatabound="GridView1_RowDataBound" onrowdeleting="GridView1_RowDeleting" 
                onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 
                onrowcommand="GridView1_RowCommand" AllowPaging="True" 
                onpageindexchanging="GridView1_PageIndexChanging">
                <Columns>
                    <%--<asp:BoundField DataField="contract_sn" HeaderText="订单号" 
                        ReadOnly="True" SortExpression="contract_sn"/>--%>
                    <asp:HyperLinkField DataNavigateUrlFields="contract_sn"
                      DataNavigateUrlFormatString="~/updateProductStatus.aspx?contract_sn={0}" 
                        DataTextField="contract_sn" HeaderText="订单号" />
                    <asp:BoundField DataField="contract_supplier" HeaderText="供货商" 
                        ReadOnly="True" SortExpression="contract_supplier" />
                    <asp:BoundField DataField="contract_account" HeaderText="账号" 
                        ReadOnly="True" SortExpression="contract_account" />
                    <asp:BoundField DataField="contract_taxsn" HeaderText="税号" 
                        ReadOnly="True" SortExpression="contract_taxsn" />
                    <asp:BoundField DataField="contract_contactName" 
                        HeaderText="联系人" ReadOnly="True" 
                        SortExpression="contract_contactName" />
                    <asp:BoundField DataField="contract_contactPhone" 
                        HeaderText="联系电话" ReadOnly="True" 
                        SortExpression="contract_contactPhone" />
                    <asp:BoundField DataField="contract_price" HeaderText="价格" 
                        ReadOnly="True" SortExpression="contract_price" />
                    <asp:BoundField DataField="contract_status" HeaderText="订单状态" 
                        ReadOnly="True" SortExpression="contract_status" />
                    <asp:ButtonField  Text="编辑" ButtonType="Link"  CommandName="编辑"/>
                    <asp:ButtonField  Text="删除" ButtonType="Link" />
                </Columns>
                <PagerSettings FirstPageText="第一页" LastPageText="最后页" NextPageText="下一页" 
                    Position="Top" PreviousPageText="上一页" />
                <PagerStyle BorderStyle="Inset" />
            </asp:GridView>
            <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
                ConnectionString="name=IMS_DBEntities" DefaultContainerName="IMS_DBEntities" 
                EnableFlattening="False" EntitySetName="order" 
                Select="it.[contract_sn], it.[contract_supplier], it.[contract_account], it.[contract_taxsn], it.[contract_contactName], it.[contract_contactPhone], it.[contract_price], it.[contract_status]">
            </asp:EntityDataSource>
            </td>
        </tr>
        </table>
            <script language="javascript">
                $(document).ready(function () {
                    $('#dateinput').datepicker();
                });  
</script>
    </asp:Content>
